package cn.baiweigang.uu.enums;

public enum ContractTypeEnum {
    this_week("this_week", "当周"),
    next_week("next_week", "次周"),
    quarter("quarter", "当季"),
    next_quarter("next_quarter", "次季"),

    btc_linear_swap("btc_linear_swap", "币本位永续合约"),
    usdt_linear_swap("usdt_linear_swap", "usdt永续合约"),
    ;

    private String code;
    private String desc;

    ContractTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ContractTypeEnum byCode(String code) {
        ContractTypeEnum[] contractTypeEnums = ContractTypeEnum.values();
        for (int i = 0; i < contractTypeEnums.length; i++) {
            if (contractTypeEnums[i].getCode().equalsIgnoreCase(code)) {
                return contractTypeEnums[i];
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
